package com.softWang.common.exception;

/**
 * 错误码定义
 *
 */
public enum ErrorCode {
	/**
	 * 成功
	 */
	SUCCESS(0,"执行成功!"),

	UNAUTHORIZED (401,"认证失败，请重新登录!"),
	FORBIDDEN (403,"没有操作权限!"),
	/**
	 * 参数不合法
	 */
	NOTNULL_PARAMS(100001,"参数不合法:"),
	/**
	 * 逻辑错误
	 */
	ERROR_LOGIC(100005,""),
	/**
	 * 系统异常
	 */
	EXCEPTION_SYS(500,"系统异常--");

	public int code;
	public String desc;
	
	private ErrorCode(int code, String desc){
		this.code = code ;
		this.desc =desc;
	}
	
	public boolean equal(ErrorCode other){
		if(this.code == other.code){
			return true;
		}else{
			return false;
		}
	}
}
